home *** CD-ROM | disk | FTP | other *** search
/ Software USA 3 #11 / Software USA Volume 3.11.iso / mac / Games / World Builder / Documentation / World Builder FAQ < prev   
Text File  |  1997-09-01  |  24KB  |  270 lines

  1.  
  2. World Builder FAQ 7.15.96
  3. By RayDunakin@aol.com
  4.  
  5. This file answers many of the most frequently asked questions about WB programming.
  6.  
  7. **How do I make the game start in the same scene everytime?
  8. Enter the name of the beginning scene in the player character's data.
  9.  
  10. **At one point in my game I have the player come across an oasis. I want them to search the pool of water and find something. How do I make the object appear when they type "search pool?"
  11.  
  12. IF{TEXT$=SEARCH}THEN
  13.     PRINT{.....................................}
  14.     IF{TEXT$=POOL}OR{TEXT$=WATER}THEN
  15.         IF{DEAD FISH=STORAGE@}THEN
  16.             MOVE{DEAD FISH}TO{SCENE@}
  17.             PRINT{You find a dead, rotting fish floating in the pool of water.}
  18.         EXIT
  19.         PRINT{There is nothing of interest in the water.}
  20.     EXIT
  21. END
  22.  
  23. One problem you will encounter with a situation like this is that some players will say "look in water" instead of "search water." So you may need to include both in your code. The "look" code should be near or at the top of the scene code, and should be written about like this:
  24.  
  25. IF{TEXT$=LOOK}AND{LOOP#>0}THEN
  26.     PRINT{.....................................}
  27.     IF{TEXT$=POOL}OR{TEXT$=WATER}THEN
  28.         IF{DEAD FISH=STORAGE@}THEN
  29.             MOVE{DEAD FISH}TO{SCENE@}
  30.             PRINT{You find a dead, rotting fish floating in the pool of water.}
  31.         EXIT
  32.         PRINT{There is nothing of interest in the water.}
  33.     EXIT
  34. END
  35.  
  36. In both these examples, I've used a conditional statement that checks to see if the object is in storage. If you don't use some kind of conditional statement, the object will show up everytime the player searches the water, even after the player already has the object. However, depending on what the object is and how it will be used, you may need to use a different condition, such as a variable, to keep track of when the object should appear. For instance, if the player is supposed to use the object to solve a puzzle, and then the object is returned to storage, if you don't want it turning up again later in the game then you should use a variable, like this:
  37.  
  38. IF{TEXT$=LOOK}AND{LOOP#>0}THEN
  39.     PRINT{.....................................}
  40.     IF{TEXT$=POOL}OR{TEXT$=WATER}THEN
  41.         IF{D1#<1}THEN
  42.             LET{D1#=1}
  43.             MOVE{DEAD FISH}TO{SCENE@}
  44.             PRINT{You find a dead, rotting fish floating in the pool of water.}
  45.         EXIT
  46.         PRINT{There is nothing of interest in the water.}
  47.     EXIT
  48. END
  49.  
  50. **How do you get money to work? I want the player to be able to buy and sell objects in the game, but don't know how.
  51. First, you need a variable to represent the player's money. For example, M1#. Then you need some code in the Global Code that will tell the player how much he has:
  52.  
  53. IF{TEXT$==$}OR{TEXT$=COUNT MONEY}THEN
  54.     PRINT{You have}
  55.     PRINT{M1#}
  56.     PRINT{gold pieces.}
  57. EXIT
  58.  
  59. Then you need some scene code that gives the player money. If the player starts the game with some money, all you really need is to set the variable:
  60.  
  61. LET{M1#=20}
  62.  
  63. In most cases this should be part of a conditional statement, otherwise this command will set the variable everytime the player makes a move.
  64.  
  65. If the player finds or earns money later in the game, you will need some scene code in each of the scenes where this is supposed to happen:
  66.  
  67. IF{TEXT$=SEARCH}THEN
  68.     IF{X1#<1}THEN
  69.         LET{M1#=M1#+10}
  70.         PRINT{You found ten gold pieces! You now have}
  71.         PRINT{M1#}
  72.         PRINT{gold pieces.}
  73.     EXIT
  74. END
  75.  
  76. And in each scene where the player can spend money, you'd need some code for that:
  77.  
  78. IF{TEXT$=BUY}OR{TEXT$=PURCHASE}THEN
  79.     IF{TEXT$=ROPE}THEN
  80.         IF{M1#<5}THEN
  81.              PRINT{You don't have enough money.}
  82.         EXIT
  83.         LET{M1#=M1#-5}
  84.         MOVE{ROPE}TO{PLAYER@}
  85.         PRINT{The clerk takes five of your gold pieces and hands you the rope.}
  86.     EXIT
  87.     IF{TEXT$=SWORD}THEN
  88.         IF{M1#<20}THEN
  89.              PRINT{You don't have enough money.}
  90.         EXIT
  91.         LET{M1#=M1#-20}
  92.         MOVE{SWORD}TO{PLAYER@}
  93.         PRINT{The clerk takes 20 of your gold pieces and hands you the sword.}
  94.     EXIT
  95.     PRINT{You can't buy that.}
  96. EXIT
  97.  
  98.  
  99. There are of course various ways that such transactions can occur, depending on the circumstances of your game and on your own personal preferences. But the code provided will be basically the same.
  100.  
  101. In my past games, I've always had an object called CASH that the player carries. However, it just makes it bit more complicated, without really adding anything to the game. In the future I will use the method described here. However, if you wish you can examine the code in my games, or in the Demo game, to see how this was accomplished.
  102.  
  103. The monetary units can be anything you want: dollars, wampum, gold pieces, credits, etc. 
  104.  
  105. **How can I put System 7 sounds or .snd sounds into my game?
  106. The WB sound converter can only recognize sounds that are in the SoundEdit format. Other sound file formats such as System 7 sounds or .snd sounds, must first be converted to SoundEdit format using a sound editing program. The sound file must be changed to SoundEdit format, and saved at 11k sampling rate. Then use the WB sound converter to put the sound into your game's sound library.
  107.  
  108. **Do you know of any shareware program that will change my sounds to SoundEdit format?
  109. There are a few available on AOL. I think the first one is probably the best, judging from the descriptions. However I haven't actually tried any of them yet:
  110.  
  111. Sound Sculptor 1.1.1
  112. Sound Editer V1.2
  113. Sample Editor 1.0.3
  114. SndSampler v2.6
  115.  
  116. **How do I make the player to move on to another scene?
  117. If the scenes are next to each other, you can just leave that direction unblocked. However, if the scenes are far apart, or there is a door or something that must be opened first, you need some scene code. Here are some examples:
  118.  
  119. IF{TEXT$=NORTH}THEN
  120.     IF{TIME PORTAL.1=SCENE@}THEN
  121.          MOVE{PLAYER@}TO{PIRATE SHIP}
  122.     EXIT
  123. END
  124.  
  125. IF{TEXT$=SOUTH}THEN
  126.     IF{DOOR.CLOSED>SCENE@}THEN
  127.         MOVE{PLAYER@}TO{BEDROOM}
  128.     EXIT
  129.     PRINT{The door is closed.}
  130. EXIT
  131.  
  132. **How do I write code to pick up things?
  133. There are two basic kinds of Objects in World Builder: Movable objects, and Immobile objects. Select the name of the object in the Objects list, then choose Object Data from the Windows menu. You'll see several boxes you can click on to select the kind of object. Movable objects can also be weapons; they can be armor; or magic objects, etc. The second screen provides a place to enter the text that will be printed when the object is picked up or clicked on, as well as additional data depending on the type of object.
  134.  
  135. For movable objects you don't need any code at all to pick them up. WB handles this automatically, either using the command "Get..." or when the player clicks on the object. Immobile objects normally can't be picked up. (You can write code to allow this, but there are problems involved and it should be avoided.)
  136.  
  137. However, in many cases you will need to use an immobile object in the scene, and a mobile object that the player can actually carry. For example, if there is a cupboard in the scene, you might need a small simple image representing a bowl in the cupboard. The main reason for using an immobile object for this is so that it will be hidden when the cupboard door is closed, and also so that the game won't automatically print a description of the object when the player enters the scene. The immobile picture of the bowl in the cupboard would be called BOWL.1 and the actual movable object would be called "bowl".
  138.  
  139. Here's how the code would be written for this example:
  140.  
  141. IF{TEXT$=GET}OR{TEXT$=TAKE}THEN
  142.     IF{TEXT$=BOWL}AND{BOWL>SCENE@}THEN
  143.         IF{BOWL.1=SCENE@}AND{CB.DOOR.CLOSED>SCENE@}THEN
  144.             MOVE{BOWL.1}TO{STORAGE@}
  145.             MOVE{BOWL}TO{PLAYER@}
  146.             PRINT{You now have the bowl.}
  147.         EXIT
  148.     END
  149. END
  150.  
  151. **How do I make a monster show up?
  152. There are a couple of ways to do this. First, you can have the creature assigned to a scene, so that it will be in that scene from the beginning of the game. To do this, just put the name of the scene in the Character's data.
  153.  
  154. If you want a creature to appear when the player takes some kind of action, then you need to write scene code to do it. Say you want a dragon to appear and block the doorway when the player tries to enter:
  155.  
  156. IF{TEXT$=EAST}THEN
  157.     IF{A1#<1}THEN
  158.         LET{A1#=1}
  159.         SOUND{WOOSH.1}
  160.         MOVE{DRAGON}TO{SCENE@}
  161.         PRINT{A large dragon appears, blocking the doorway!}
  162.         PRINT{DRAGON: "No mortal shall enter the sacred temple! Only those who have sipped from the Golden Chalice may pass through!"}
  163.     EXIT
  164. END
  165.  
  166. In this example, a conditional statement and variable are needed to make sure that the dragon only appears once. Otherwise, the same thing would keep happening over and over everytime the player tried to enter the door.
  167.  
  168. Also, although you can do this with Characters, in most cases it is better to use an Object for your creatures. If you just need a simple creature that the player can easily kill using ordinary weapons, a Character will do. But for more complex actions, it's easier to use an Object, and write scene code to control the action. 
  169.  
  170. For instance, in the example given above, the dragon merely guards the door, and does not attack or run away. If you used a Character for this, there would be no way to insure that the dragon would not attack or run when it wasn't supposed to. By making the dragon and Object, you can be sure that it won't do anything that you don't want it to, and only when you want it to. Of course, the dragon should be able to attack the player if the player tries to pass it, and it should be able to defend itself if the player tries to kill it. But even this can be handled in scene code.
  171.  
  172. **I don't understand {LOOP#}. Could you please try to explain this to me?
  173. LOOP# refers to the number of commands or actions taken in a scene. When the player first enters a scene, he hasn't done anything in that scene yet (during that specific visit), so LOOP# is automatically set to zero. Any statements in the scene or global code that are supposed to take place during LOOP# zero will be executed as the scene is loading. Everytime the player enters any scene the LOOP# is reset to zero, no matter how many times he may have been in that same scene before. 
  174.  
  175. Once the player is in the scene, every time he enters a command or clicks on an object, it increases the LOOP#.
  176.  
  177. In my games, I use LOOP# most often for things like whether or not a scene should be dark. If the player has a light, and the light has good batteries, then the DARK object (a black square covering the scene) is moved to storage, and the variable that keeps track of the battery's life is updated. If the batteries are dead or the player doesn't have the light, then the DARK is moved to the scene.
  178.  
  179. LOOP# zero is also useful for moving other characters or objects to the scene, and for updating certain variables. 
  180.  
  181. **Can I use scanned pictures for the scenes or characters?
  182. Not really. You can scan them, but they have to be converted to 1-bit images, which are really poor quality. And even then it can be tricky getting them to work in WB, especially if they are the size of a full scene. Plus they take up a lot more disk space.
  183.  
  184. **Can I put color into my game? Will there ever be a way to make color WB games?
  185. No. You can't put color into a WB game, and there will never be a color version of World Builder.  
  186.  
  187. **I want to make a button or sign with text on it. Do I have to draw the text with the bitbox?
  188. Nope. Use another graphics program, such as SuperPaint, MacDraw, or even Photoshop to do lettering for WB graphics. After you paste the lettering into WB, it will be in the form of a bitmap. Be sure to use the bitbox tool to crop it as close to the lettering as possible, in order to make the bitmap as small as possible, thus eliminating any unnecessary data.
  189.  
  190. **How can I make a scene be light or dark depending on whether the player has a flashlight?
  191. In my games I have an object called DARK that is just a large black rectangle that covers the entire scene. In the scene code, there is some code that checks to see if the player has the flashlight, and if the flashlight's batteries are still charged. If both of these are true, then the DARK is moved to storage. If one of these is not true, then DARK is moved to the scene. In each case the scene description is changed to describe the situation. Also, everytime the flashlight is used, the code subtracts one from the variable that represents the charge of the batteries. When the variable reaches zero, then the batteries are dead and the player needs to put in new batteries.
  192.  
  193. **In my games, my art is OKAY, but since I am only 12, I still have  a rough time making good 3-d art!!!! Who does the art in your games? Do you do it?
  194. Yes, I do it. I'm a professional artist (and I'm 41), so I have a lot of experience. But don't let that fool you, anyone can learn to do the kind of simple art needed for a WB game. The first thing you need to do is learn about using perspective. There are plenty of inexpensive art books on the subject (or just study the way other people draw and learn from that). Second is getting used to drawing with the mouse on the computer. It took me a while to get used to that! It's so much different from drawing with a pencil. One thing to bear in mind is, don't use the freehand tool, use the polygon tool instead. It gives you better control. Also, you can always use "Reshape polygon.." in the Edit menu to fine-tune your drawing.
  195.  
  196. Third, practice practice practice! There's no substitute for practice.
  197.  
  198. **What programs would you recommend I use to make the pictures in WB?
  199. I mostly use WB's built-in drawing tools. I do use SuperPaint sometimes, for things where I need to be able to flip or rotate or reduce some drawing. I also use SP to do the lettering for signs and stuff. You must take care to avoid having the art converted to a bitmap when it is pasted into WB. (See below)
  200.  
  201. ** How can I import images from other programs into World Builder?
  202. You can paste in some "paint" type art, but it will be converted to a bitmap, which takes up a lot of disk space. You can also paste in some photos, if you first convert them to bitmaps using Photoshop or a similar program. However, photos don't usually come out very well in WB. 
  203.  
  204. You can also do graphics using the "draw" layer in SuperPaint, and paste them into WB. Usually it will retain the "draw" characteristics when it is pasted in. By this I mean that you will still be able to select the individual shapes within the drawing, change the fill, etc. However, if you flip any shapes that you create in SuperPaint, that shape will be converted to bitmap in WB. If a drawing contains a flipped shape, the entire drawing will convert to bitmap. You want to avoid this. You can  retrace the flipped shape and delete the original before pasting it into WB, and then it will work. 
  205.  
  206. Also, any drawing that you do in WB can be pasted into SP, then stretched, enlarged, or reduced, and pasted back into WB without losing the shape characteristics. Rotating a shape in SP will cause it to be converted to bitmap. Occasionally you may have trouble pasting a flipped WB drawing.If this is the case, simply retrace the flipped drawing, then delete the original.
  207.  
  208. **How can I have more than one player character in World Builder?
  209. I have two player characters in A Mess O'Trouble. The way I did it is, there is actually only one, called "adventurer." At the beginning of the game when the player chooses between Fearless Frank or Daredevil Dawn, I use a variable to register the player's choice. If Frank is selected, the variable (F2#) is set to one. If Dawn is selected, the variable is set to 2. I also set the player's attributes, such as strength, hit points, etc., although this isn't absolutely necessary. 
  210.  
  211. During the game, anytime that the game needs to refer to the name or gender of the player, I just use some code that tests for the value of the variable, like this:
  212.  
  213. IF{TEXT$=TALK}OR{TEXT$=INFO}OR{TEXT$=ASK}THEN
  214.     IF{F2#=1}THEN
  215.         PRINT{INNKEEPER: "I'm sorry sir, I have no information for you today."}
  216.     EXIT
  217.     IF{F2#=2}THEN
  218.         PRINT{INNKEEPER: "Greetings, Miss! A stranger came by today and asked me to give you this message."}
  219.     PRINT{"He said that there is something important buried next to the Tree of Death."}
  220.     EXIT
  221. EXIT
  222.  
  223. **In the character data it says things like "Winning, offer" or "Losing, offer." What does this mean?
  224. An offer is when the player offers something to another character. It's the same as "give", except that WB only recognises "offer" unless you write code that includes "give". I always do, since that's the word most people use.
  225.  
  226. Any actual Character other than the player character can automatically accept or reject an offered item, and can also automatically offer an item that is in its possession. So if you are using a Character to be a monster or villain of some sort, the player can try to offer it something to avoid having to fight it. When you set the bar graph in the Character's data, that means that the Character will only accept objects that have a higher value. Anything with a lesser value will be rejected. And there is a bar graph that allows you to set how likely the Character will be to offer the player something instead of fighting.
  227.  
  228. However, since actual Characters are not under the game maker's complete control, but are run by the computer, it is better in most cases not to use them. Use an Object instead, and write scene code to handle all it's reactions and interaction with the player.
  229.  
  230. **What is a bitmap, and what does the bitbox tool do?
  231. Well, a bitbox is a tool that is used to create bitmaps. A bitmap is a picture made up of individual pixels (dots). The other draw tools create graphics that are defined by a few calculations. For instance, the only data needed for a rectangle is the location of the four corners. But a bitmap records the location of every pixel, so it requires more disk space. If you made a bitmap of a rectangle, every dot in the rectangle would be saved in data. 
  232.  
  233. The purpose of a bitmap is that it allows you to edit each pixel, using "Zoom bits..." under the Edit menu. This way you can create special drawings that aren't possible, or easy to do, using the other tools. 
  234.  
  235. Some graphics can be imported into WB, and they are usually converted into bitmaps. If you need text for a sign, for instance, you can use SuperPaint, MacDraw, or some other program to make the lettering, then paste it into WB. It will be pasted in in the form of a bitmap. You can even scan some pictures and turn them into bitmaps, however the bitmaps make very low quality pictures, so that they are usually not acceptable quality for photos.
  236.  
  237. To make a bitmap in WB, drag the bitbox tool over the area you want to convert, and then do "Capture bits..." under the Edit menu. You can make a bitmap from a blank area of the scene, or you can do it right over a drawing made from the normal draw tools. Whatever is in the area selected by the bitbox tool will be copied as a bitmap. Note that it does NOT effect the original drawing, it only makes a bitmapped copy of it. 
  238.  
  239. You can then do Zoom bits and individually erase or draw each pixel to modify the image as needed. 
  240.  
  241. Bitmaps are useful for somethings that need a small area with a lot of detail, like the face of a small character. In cases where the bitmap is very small and there is a lot of detail, the bitmap will actually require less data than it would if you used the draw tools. However, large bitmaps should be avoided, since they do increase the data considerably. You can experiment with various drawings using bitmaps and draw tools, and then click on the Info button for the scene or object, and it will tell you how many bytes are required for the graphics.
  242.  
  243. Also, when you paste in text or something that is converted to a bitmap, it often has a large transparent border. You can use the bitbox tool to select only the lettering or image, do Capture Bits, and then delete the original. This will eliminate the excess.
  244.  
  245. **You recommend using Objects to represent non-player characters. If that's the case, why does WB even have Characters? Can you give an example of when you should use actual Characters instead of Objects?
  246. The Characters were originally intended to give the game a sort of RPG effect, where the player would go around fighting various monsters and villians, gaining experience with each one he defeated. However, in practice it just doesn't make a very interesting game. That became one of the downfalls of most WB games. They all tended to be very repetitious and annoying, and there was little brainwork needed to solve them, since all you were doing was using the Weapons menu over and over. And because the game author doesn't have much control over Characters, it makes it difficult to use them in more complex situations such as talking to them, bartering with them, etc. 
  247.  
  248. I only use Characters for very simple creatures. For instance, I might have a rat that creeps around in the catacombs. Since it is a just a minor creature that doesn't have any complex interactions with the player, making it a Character and letting the computer control its actions works fine. I can adjust its attributes so that it will be fairly weak compared to the player, or even make it have no weapons at all to attack with. Such a Character, if used sparingly, adds a touch of life to a scene without a lot of code. 
  249.  
  250.  
  251. ** Is there a way to set a timer in the game to make an event happen over and over with a timed interval between each?
  252. Yes and no. You can cause events to repeat at specific intervals, however those intervals will be based on the player's moves, not time. There is no way to actually include real time in the game. 
  253.  
  254. There are at least a couple of way to make a counter that repeats events, depending on what exactly you want to do. If it is only supposed to happen in one scene, you could do it in scene code, either using the LOOP# or a variable. In a case where the counter and event must take place in a small group of scenes, you could still do it with a variable, but not with the LOOP#. If the counter and event is supposed to happen throughout the game, you'd need global code, using a variable. However, since global code can be superceeded by scene code, the counter will not be updated with every move, only by those moves that are not handled in scene code.
  255.  
  256. *** Large blocks of text (like when characters are telling stories) will get cut off in the middle of a sentence, or sometimes nothing appears at all. How can I stop this?
  257. For some reason WB can't handle long PRINT commands. Break up the story into one or two sentences, with a seperate PRINT command for each section. 
  258.  
  259. *** When I try to open saved games, it says "This game is not from this world".
  260. If you have more than one WB game on your mac at the same time, the program gets confused when you try to start up a saved game by double-clicking on it. The way around this is to start up the game itself, then close the new game and open the saved game from the File Menu.
  261.  
  262. ***Is there a way to designate text variables to be printed later on? I want to be able to use the player's own name in my game.
  263. Unfortunately there is no way to designate text variables like that. I wish there was! The closest thing you can do is give the player a specific choice of predesignated names, like between Frank and Dawn in my game. Then set a variable for that choice.
  264.  
  265. ***In that case, is it possible to have the player input a number, assign that number to a numeric variable, and manipulate it later on?
  266. Nope. There's just no way to do that kind of thing. WB can read what the player inputs, but it can't hold it for later use. This applies to both letters and numbers.
  267.  
  268.  
  269.  
  270.